import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)

Router.prototype.goBack = function () {
  this.isBack = true
  window.history.go(-1)
}
const main = () => import(/* webpackChunkName: "home" */'@/components/main/main')
const home = () => import(/* webpackChunkName: "home" */'@/components/home/home')
const willsale_list = () => import(/* webpackChunkName: "home" */'@/components/home/willsale_list')
const seckill_list = () => import(/* webpackChunkName: "home" */'@/components/home/seckill_list')
const search = () => import(/* webpackChunkName: "home" */'@/components/home/search')
const choose_positon = () => import(/* webpackChunkName: "home" */'@/components/home/choose_positon')
const notify_list = () => import(/* webpackChunkName: "home" */'@/components/home/notify_list')
const notify_detail = () => import(/* webpackChunkName: "home" */'@/components/home/notify_detail')
const sort = () => import(/* webpackChunkName: "sort" */'@/components/sort/sort')
const activity = () => import(/* webpackChunkName: "activity" */'@/components/activity/activity')
const shopcar = () => import(/* webpackChunkName: "shopcar" */'@/components/shopcar/shopcar')
const my = () => import(/* webpackChunkName: "my" */'@/components/my/my')
const my_kefu = () => import(/* webpackChunkName: "my" */'@/components/my/my_kefu')
const my_collection = () => import(/* webpackChunkName: "my" */'@/components/my/my_collection')
const my_footprint = () => import(/* webpackChunkName: "my" */'@/components/my/my_footprint')
const my_vip = () => import(/* webpackChunkName: "my" */'@/components/my/my_vip')
const my_member = () => import(/* webpackChunkName: "my" */'@/components/my/my_member')
const my_jfshop = () => import(/* webpackChunkName: "my" */'@/components/my/my_jfshop')
const my_jfshop_detail = () => import(/* webpackChunkName: "my" */'@/components/my/my_jfshop_detail')
const my_change_record = () => import(/* webpackChunkName: "my" */'@/components/my/my_change_record')
const my_choujiang = () => import(/* webpackChunkName: "my" */'@/components/my/my_choujiang')
const my_ward_record = () => import(/* webpackChunkName: "my" */'@/components/my/my_ward_record')
const unline_shop = () => import(/* webpackChunkName: "my" */'@/components/my/unline_shop')
const my_coupon = () => import(/* webpackChunkName: "my" */'@/components/my/my_coupon')
const login = () => import(/* webpackChunkName: "login" */'@/components/login/login')
const member_login = () => import(/* webpackChunkName: "login" */'@/components/login/member_login')




/*my*/
const my_userinfo = () => import(/* webpackChunkName: "my" */'@/components/my/my_userinfo')
const update_phone = () => import(/* webpackChunkName: "my" */'@/components/my/update_phone')
const update_name = () =>  import(/* webpackChunkName: "my" */'@/components/my/update_name')
const update_pass = () =>  import(/*webpackChunkName:"my" */ '@/components/my/update_pass')
const my_order = () => import(/*webpackChunkName:"my" */ '@/components/my/my_order')
// const my_collection = () =>import(/*webpackChunkName:"my" */ '@/components/my/my_collection')
const my_address = () => import(/*webpackChunkName:"my" */ '@/components/my/my_address')
const my_address_edit = () => import(/*webpackChunkName:"my" */ '@/components/my/my_address_edit')
const my_address_add = () => import(/*webpackChunkName:"my" */ '@/components/my/my_address_add')
const my_pingjia = () => import(/*webpackChunkName:"my" */ '@/components/my/my_pingjia')

// const my_order_all = () => import(/*webpackChunkName:"my" */ '@/components/my/my_order_all')
// const my_order_pay = () => import(/*webpackChunkName:"my" */ '@/components/my/my_order_pay')
// const my_order_send = () => import(/*webpackChunkName:"my" */ '@/components/my/my_order_send')
// const my_order_get = () => import(/*webpackChunkName:"my" */ '@/components/my/my_order_get')
// const my_order_pingjia = () => import(/*webpackChunkName:"my" */ '@/components/my/my_order_pingjia')

const my_order_detail = () => import(/*webpackChunkName:"my" */ '@/components/my/my_order_detail')


// const my_order_pingjia_detail = () => import(/*webpackChunkName:"my" */ '@/components/my/my_order_pingjia_detail')
// const my_order_pay_detail = () => import(/*webpackChunkName:"my" */ '@/components/my/my_order_pay_detail')
// const my_order_get_detail = () => import(/*webpackChunkName:"my" */ '@/components/my/my_order_get_detail')
// const my_order_send_detail = () => import(/*webpackChunkName:"my" */ '@/components/my/my_order_send_detail')



/*goods*/
const grouplist = () => import(/* webpackChunkName: "goods" */'@/components/goods/grouplist')
const groupdetails = () => import(/* webpackChunkName: "goods" */'@/components/goods/groupdetails')
const goodsdetail = () => import(/* webpackChunkName: "goods" */'@/components/goods/goodsdetail')
const comment = () => import(/* webpackChunkName: "goods" */'@/components/goods/comment')
const confirm_order = () => import(/* webpackChunkName: "shopcar" */'@/components/shopcar/confirm_order')

export default new Router({
  routes: [
    {
      path: '/',
      // name: 'main',
      component: main,
      children: [
        {
          path: '/',
          redirect: {name: 'home'}
        },
        {
          path: '/home',
          name: 'home',
          component: home
        },
        {
          path: '/sort',
          name: 'sort',
          component: sort
        }, {
          path: '/activity',
          name: 'activity',
          component: activity
        },
        {
          path: '/shopcar',
          name: 'shopcar',
          component: shopcar
        },
        {
          path: '/my',
          name: 'my',
          component: my
        }
      ]
    },{
      path: '/login',
      name: 'login',
      component: login,
    },{
      path: '/member_login',
      name: 'member_login',
      component: member_login,
    },{
      path: '/my_userinfo',
      name: 'my_userinfo',
      component: my_userinfo
    },{
      path: '/update_phone',
      name: 'update_phone',
      component:update_phone
    },{
      path: '/update_name',
      name: 'update_name',
      component: update_name
    },{
      path: '/update_pass',
      name: 'update_pass',
      component:update_pass
    },{
      path: '/grouplist',
      name: 'grouplist',
      component:grouplist
    },
    {
      path: '/groupdetails/*',
      name: 'groupdetails',
      component:groupdetails
    },
    {
      path: '/goodsdetail/*',
      name: 'goodsdetail',
      component:goodsdetail
    },{
      path: '/comment/*',
      name: 'comment',
      component:comment
    },{
      path: '/search',
      name: 'search',
      component:search
    },{
      path: '/choose_positon',
      name: 'choose_positon',
      component:choose_positon
    },{
      path: '/notify_list',
      name: 'notify_list',
      component:notify_list
    },{
      path: '/willsale_list',
      name: 'willsale_list',
      component:willsale_list
    },{
      path: '/seckill_list',
      name: 'seckill_list',
      component:seckill_list
    },{
      path: '/notify_detail',
      name: 'notify_detail',
      component:notify_detail
    },{
      path: '/my_kefu',
      name: 'my_kefu',
      component:my_kefu
    },{
      path: '/my_collection',
      name: 'my_collection',
      component:my_collection
    },{
      path: '/my_footprint',
      name: 'my_footprint',
      component:my_footprint
    },{
      path: '/my_vip',
      name: 'my_vip',
      component:my_vip
    },{
      path: '/my_member',
      name: 'my_member',
      component:my_member
    },{
      path: '/my_jfshop',
      name: 'my_jfshop',
      component:my_jfshop
    },{
      path: '/my_jfshop_detail',
      name: 'my_jfshop_detail',
      component:my_jfshop_detail
    },
    {
  path: '/my_choujiang',
  name: 'my_choujiang',
  component:my_choujiang
},{
  path: '/my_ward_record',
  name: 'my_ward_record',
  component:my_ward_record
},{
  path: '/unline_shop',
  name: 'unline_shop',
  component:unline_shop
},{
  path: '/my_coupon',
  name: 'my_coupon',
  component:my_coupon
},{
  path: '/my_change_record',
  name: 'my_change_record',
  component:my_change_record
},{
  path: '/my_order/*',
  name: 'my_order',
  component:my_order
},{
  path: '/my_order_detail/*',
  name: 'my_order_detail',
  component:my_order_detail
},{
  path: '/my_address',
    name: 'my_address',
    component:my_address
},{
  path: '/my_address_edit',
    name: 'my_address_edit',
    component:my_address_edit
},{
  path: '/my_address_add',
    name: 'my_address_add',
    component:my_address_add
},  {
  path: '/confirm_order/*',
    name: 'confirm_order',
    component:confirm_order
}

]
})
